using Godot;
using System;
public partial class StateMeachine : Node
{
	public StateNode current = null;
		
	public StateMeachine(StateNode node)
	{
		current = node;
		current?.OnEnter();
	}

	public void SwitchTo(StateNode node)
	{			
		var pre = current.GetType().ToString();
		current.OnExit();

		current = node;
		current.OnEnter();
		// GD.Print(pre+" to "+current.GetType());
	}

    public void OnUpdate(float delta)
    {
        current.OnUpdate(delta);
    }
}
